/*
* @desc:xxxx功能描述
* @company:云南奇讯科技有限公司
* @Author: yixiaohu<yxh669@qq.com>
* @Date:   2024/2/4 15:30
 */

package model

import "github.com/gogf/gf/v2/frame/g"

type TextValue struct {
	Value string `json:"value"`
	Position
}
type Position struct {
	X int `json:"x"`
	Y int `json:"y"`
}
type FlowModelNodeAddReq struct {
	NodeId         string     `p:"nodeId"         `
	ModelId        uint64     `p:"modelId"        `
	NodeType       string     `p:"nodeType"       `
	NodePosition   *Position  `p:"nodePosition"   `
	NodeText       *TextValue `p:"nodeText"       `
	NodeActionRule int        `p:"nodeActionRule" `
	NodeReceiver   []uint64   `p:"nodeReceiver"   `
	NodeRule       int        `p:"nodeRule"       `
	Notice         []string   `p:"notice"         `
	Rollback       int        `p:"rollback"       `
	NodeStep       string     `p:"nodeStep"       `
}

type FlowNodeLineAddReq struct {
	ModelId      int64       `p:"modelId"      `
	LineType     string      `p:"lineType"     `
	SourceNodeId string      `p:"sourceNodeId" `
	TargetNodeId string      `p:"targetNodeId" `
	StartPoint   *Position   `p:"startPoint"   `
	EndPoint     *Position   `p:"endPoint"     `
	Properties   g.Map       `p:"properties"   `
	Text         *TextValue  `p:"text"         `
	PointsList   []*Position `p:"pointsList"  `
}

type Nodes struct {
	NodeId         string     `json:"nodeId"         description:"节点ID"`
	ModelId        uint64     `json:"modelId"        description:"流程模型ID"`
	NodeType       string     `json:"nodeType"       description:"节点类型"`
	NodePosition   *Position  `json:"nodePosition"   description:"节点位置坐标信息"`
	NodeText       *TextValue `json:"nodeText"       description:"节点名称信息"`
	NodeActionRule int        `json:"nodeActionRule" description:"接收方式"`
	NodeReceiver   []uint64   `json:"nodeReceiver"   description:"接收者信息"`
	NodeRule       int        `json:"nodeRule"       description:"审核规则"`
	Notice         []string   `json:"notice"         description:"通知方式"`
	Rollback       int        `json:"rollback"       description:"允许退回"`
	NodeStep       string     `json:"nodeStep"       description:"节点步骤"`
}

type Edges struct {
	Id           int64       `json:"id"           description:"主键ID"`
	ModelId      int64       `json:"modelId"      description:"模型ID"`
	LineType     string      `json:"lineType"     description:"线条类型"`
	SourceNodeId string      `json:"sourceNodeId" description:"源节点ID"`
	TargetNodeId string      `json:"targetNodeId" description:"目标节点ID"`
	StartPoint   *Position   `json:"startPoint"   description:"起始位置"`
	EndPoint     *Position   `json:"endPoint"     description:"结束位置"`
	Properties   g.Map       `json:"properties"   description:"属性"`
	Text         *TextValue  `json:"text"         description:"名称信息"`
	PointsList   []*Position `json:"pointsList"  `
}

type NodeInfoRes struct {
	Nodes []*Nodes `json:"nodes"`
	Edges []*Edges `json:"edges"`
}
